//
//  ChannelVoiceCollectionViewCell.m
//  TestApplication
//
//  Created by Hanlingyu on 16/9/14.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "ChannelVoiceCollectionViewCell.h"
#import "ChannelVoice.h"
#import "UIImageView+WebCache.h"
#import "SelfSizeTool.h"
#import "TAMacro.h"
#import "NSString+Time.h"
@interface ChannelVoiceCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *photoImage;
@property (weak, nonatomic) IBOutlet UILabel *contentText;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@end

@implementation ChannelVoiceCollectionViewCell


- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        
        
    }
    return self;
}

- (void)setVoice:(ChannelVoice *)voice {
    _voice = voice;
//    CGFloat lengthHeight = [SelfSizeTool selfSizeHeightWithString:_voice.name width:(SCREEN_WIDTH - 44) / 2 font:[UIFont systemFontOfSize:13]];
//                            
//    if (lengthHeight > 16) {
//        <#statements#>
//    }
    
    _timeLabel.text = [NSString convertTime:_voice.length];
    _contentText.text = [NSString stringWithFormat:@"%@", _voice.name];
    [_photoImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://qn.zheli.io/%@", _voice.bgImage]]];
 
}

- (void)layoutSubviews {
    [super layoutSubviews];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

@end
